package cloud.lysky.java.on.design_pattern.strategy;

/**
 * @author luoly
 * @describe
 * @date 2022-08-20 10:17
 **/
//校验器
public class Validator {
    private final ValidationStrategy strategy;


    public Validator(ValidationStrategy strategy) {
        this.strategy = strategy;
    }

    public boolean validate(String s){
        return strategy.execute(s);
    }
}